/*
 * @Description: 
 * @Author: Hadlee
 * @Date: 2024-11-10 21:07:06
 */
#ifndef __USBCORE_H__
#define __USBCORE_H__

#include "MyType.h"


#define GET_STATUS          (0)
#define CLEAR_FEATURE       (1)
#define SET_FEATURE         (3)
#define SET_ADDRESS         (5)
#define GET_DESCRIPTOR      (6)
#define SET_DESCRIPTOR      (7)
#define GET_CONFIGURATION   (8)
#define SET_CONFIGURATION   (9)
#define GET_INTERFACE       (10)
#define SET_INTERFACE       (11)
#define SYNCH_FRAME         (12)

#define DEVICE_DESCRIPTOR           (1)
#define CONFIGURATION_DESCRIPTOR    (2)
#define STRING_DESCRIPTOR           (3)
#define INTERFACE_DESCRIPTOR        (4)
#define ENDPOINT_DESCRIPTOR         (5)
#define REPORT_DESCRIPTOR           (0x22)

#define SET_IDLE 0x0A


/**************************************************************
function:Usb disconnect function
input: None
return: None
Note: None
**************************************************************/
void UsbDisconnect(void);

/**************************************************************
function:Usb connect function
input: None
return: None
Note: None
**************************************************************/
void UsbConnect(void);

void UsbBusSuspend(void);

void UsbBusReset(void);

/**
 * USB ep0 interrupt handle
*/
void UsbEp0Out(void);
void UsbEp0In(void);

/**
 * USB ep1 interrupt handle
*/
void UsbEp1Out(void);
void UsbEp1In(void);

/**
 * USB ep2 interrupt handle
*/
void UsbEp2Out(void);
void UsbEp2In(void);

void UsbEp0SendData(void);

extern uint8_t ConfigValue;  //当前配置值
extern uint8_t Ep1InIsBusy;  //端点1输入是否忙

#endif

